USE GESTION2
go
IF OBJECT_ID('dbo.WASP_D0006_LIMPIA_TABLAS') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.WASP_D0006_LIMPIA_TABLAS
    IF OBJECT_ID('dbo.WASP_D0006_LIMPIA_TABLAS') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.WASP_D0006_LIMPIA_TABLAS >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.WASP_D0006_LIMPIA_TABLAS >>>'
END
go
SET ANSI_NULLS ON
go
SET QUOTED_IDENTIFIER ON
go
CREATE PROCEDURE WASP_D0006_LIMPIA_TABLAS
AS

BEGIN
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PENPF000]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PENPF000]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[penpf000_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[penpf000_temp]
END
go
SET ANSI_NULLS OFF
go
SET QUOTED_IDENTIFIER OFF
go
IF OBJECT_ID('dbo.WASP_D0006_LIMPIA_TABLAS') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.WASP_D0006_LIMPIA_TABLAS >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.WASP_D0006_LIMPIA_TABLAS >>>'
go
